package com.qidian.mes.device.controller;

import com.qidian.common.pojo.MESResult;
import com.qidian.mes.device.service.HouseService;
import com.qidian.mes.pojo.House;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 刘泽磊
 * @Company 起点编程
 * @Description
 * @Time 2024/10/25 10:40
 */
@RestController
@RequestMapping("/house")
@CrossOrigin
public class HouseController {
    @Autowired
    private HouseService houseService;
    @GetMapping("/list")
    public MESResult select(House house){
        return houseService.select(house);
    }
    @PostMapping("/insert")
    public MESResult insert(@RequestBody House house){
        return houseService.insert(house);
    }
    @PutMapping("/update")
    public MESResult update(@RequestBody House house){
        return houseService.update(house);
    }
    @GetMapping("/selectById")
    public MESResult selectById(Long houseId){
        return houseService.selectById(houseId);
    }
    @DeleteMapping("/delete")
    public MESResult delete(Long houseId){
        return houseService.delete(houseId);
    }
}
